// 主页子路由
const router = require('koa-router')()
const fs = require('fs')
router
  .get('', function (ctx) {
    ctx.body = 'Home page'
  })

  .post('login', function (ctx) {
    ctx.body = 'this a login page!';
  })

  .post('upload', async (ctx) => {
    const file = ctx.request.files.file
    ctx.body = file.path
    console.log(file.name)
  })

module.exports = router